import sys
sys.path.append('.') # allow to find modules 'here'

# ----------------------------------------------------
import wx
import wx.aui
import wx.py 
import wx.glcanvas
import wx.lib.flatnotebook as fnb
import math
      
#---------------------------------------------------------------------------

class TestFrame(wx.Frame):
    def __init__(self, parent=None, ID=-1, title='pyOSG' ):
        wx.Frame.__init__(self, parent, ID, title)
        
        #-- shell---------------------------------------------
        self.shell = wx.py.shell.Shell(self, -1, introText="",style =wx.NO_BORDER)

        #-- main---------------------------------------------
        self.p = wx.Panel(self,-1)

        # --- Layout ---------------------------------
        self.SetSize(wx.Size(600,600))
        self._mgr = wx.aui.FrameManager()
        self._mgr.SetManagedWindow(self)
        self._mgr.GetArtProvider().SetColor(wx.aui.AUI_ART_INACTIVE_CAPTION_COLOUR, wx.Color(0,150,255)) 
        self._mgr.GetArtProvider().SetColor(wx.aui.AUI_ART_INACTIVE_CAPTION_GRADIENT_COLOUR, wx.Color(0,80,255)) 
        self._mgr.GetArtProvider().SetColor(wx.aui.AUI_ART_INACTIVE_CAPTION_COLOUR, wx.Color(80,150,255)) 
        self._mgr.GetArtProvider().SetColor(wx.aui.AUI_ART_INACTIVE_CAPTION_GRADIENT_COLOUR, wx.Color(80,150,255)) 

        self._mgr.AddPane(self.p, wx.aui.PaneInfo().
                        Name("CenterPane").CenterPane())

        self._mgr.AddPane(self.shell, wx.aui.PaneInfo().CaptionVisible(False).
                        Name("shell").Caption("shell").Bottom().
                        BestSize(wx.Size(200,200)).MinSize(wx.Size(200,10)))
        
        #self._mgr.AddPane(self.cp, wx.aui.PaneInfo().Fixed().CaptionVisible(False).
        #                Name("controls").Caption("controls").Right().
        #                BestSize(wx.Size(70,100)).MinSize(wx.Size(70,100)))

        self._mgr.Update()

        # --- Bindings ---------------------------------
        self.Bind(wx.EVT_CLOSE, self.OnClose)
        #self.Bind(wx.EVT_TIMER, self.OnTimer, id=self.timer.GetId() )
                
    def OnClose(self, event):
        #self.viewer.setSceneData(None)
        self.timer.Stop()
        self.node = None
        self.viewer = None
        self.Destroy()
        
#---------------------------------------------------------------------------

class TestApp(wx.App):
    def OnInit(self):
        self.frame = TestFrame()
        self.SetTopWindow(self.frame)
        self.frame.Show() 
        return True
   
#---------------------------------------------------------------------------

if __name__ == '__main__':
    app = TestApp(0)
    app.MainLoop()
    
    

